/**
 * All rights Reserved, Designed By 林溪开源
 * Copyright:    Copyright(C) 2016-2020
 * Company       林溪开源 Ltd.
 */

package com.boots.atomikos.view.afcustomer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.boots.atomikos.business.afcustomer.service.IAfCustomerService;
import com.module.boots.api.message.ResponseMsg;
import com.module.boots.api.utils.MsgUtils;
import com.module.boots.exception.CommonRuntimeException;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;

/**
 * 客户表后台接口
 * @author：林溪
 * @date： 2020年11月17日
 */
@Api(tags = { "客户表接口" })
@RestController
@RequestMapping("view/afCustomer")
public class AfCustomerView {

    @Autowired
    private IAfCustomerService afCustomerService;

    @ApiOperation(value = "测试分布式数据源")
    @GetMapping(value = "/test", produces = MediaType.APPLICATION_JSON_VALUE)
    @SneakyThrows(CommonRuntimeException.class)
    public ResponseMsg<String> test() {
        afCustomerService.test();
        return MsgUtils.buildSuccessMsg("新增成功");
    }

}
